home *** CD-ROM | disk | FTP | other *** search
/ Java for 3D & VRML Worlds / Java for 3d and VRML Worlds.iso / examples / chap04 / ProtoMan.wrl < prev    next >
Text File  |  1996-10-14  |  2KB  |  62 lines

  1. #VRML V2.0 utf8
  2.  
  3. PROTO WalkingMan[       exposedField SFVec3f translation 0 0 0
  4.                         exposedField SFRotation rotation 1 0 0 0
  5.                         exposedField SFTime walkingCycle 1]{
  6.         Transform{
  7.                 translation IS translation
  8.                 rotation    IS rotation
  9.                 children[
  10.  
  11.                 DEF MAN Transform{
  12.                         children[
  13.                         LOD{
  14.                                 level[
  15.                                 Inline{url "ManDetailed.wrl"},
  16.                                 Inline{url "ManRough.wrl"}
  17.                                 ]
  18.                                 range[10]
  19.                         }
  20.                         ]
  21.                 },
  22.                 DEF MAN_TIME TimeSensor{
  23.                         loop TRUE
  24.                         cycleInterval IS walkingCycle
  25.                 },
  26.                 DEF MAN_POSINT PositionInterpolator{
  27.                         key [0, 1]
  28.                         keyValue [0 0 0, 0 0 10]
  29.                 },
  30.                 DEF MAN_SCRIPT Script{
  31.                         url "ProtoMan.class"
  32.                         eventIn SFTime cycleEnd 
  33.                         eventOut MFVec3f setPath
  34.                 }
  35.                 ]
  36.         }
  37.         ROUTE MAN_TIME.fraction_changed TO MAN_POSINT.set_fraction
  38.         ROUTE MAN_POSINT.value_changed TO MAN.set_translation
  39.         ROUTE MAN_TIME.cycleTime TO MAN_SCRIPT.cycleEnd
  40.         ROUTE MAN_SCRIPT.setPath TO MAN_POSINT.set_keyValue
  41. }
  42.  
  43. Viewpoint{
  44.         position 0 0 3
  45. }
  46.  
  47. WalkingMan{
  48.         translation 0 0 -5
  49.         walkingCycle 3
  50. }
  51.  
  52. WalkingMan{
  53.         translation 3 0 -8
  54.         walkingCycle 5
  55. }
  56.  
  57. WalkingMan{
  58.         translation -3 0 -5
  59.         rotation 0 1 0 0.78
  60.         walkingCycle 7
  61. }
  62.